unit subFrm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, 
  Controls, Forms, Dialogs, StdCtrls,
  MainFrm; 

type
  TSubForm = class(TForm)
    Edit1  : TEdit;
    Label1: TLabel;
    Add      : TButton;
    Apply  : TButton;
    procedure ApplyClick(Sender: TObject);
    procedure AddClick(Sender: TObject);
  private
    parentForm:TMainForm; 
    { Private declarations }
  public
    procedure SetMainForm(parent:TMainForm);
    { Public declarations }
  end;

var
  SubForm : TSubForm;

implementation

{$R *.DFM}

procedure TSubForm.SetMainForm(parent: TMainForm);
begin
     parentForm:=Parent;
end;

procedure TSubForm.ApplyClick(Sender: TObject);
begin
     parentForm.Memo1.Lines.add(Edit1.Text);
end;

procedure TSubForm.AddClick(Sender: TObject);
begin
    parentForm.Memo1.Lines.add(Edit1.Text);
    Close();
end;

end.
